//package com.huanong.it.xwcommon.config;
//
//import org.aopalliance.intercept.MethodInterceptor;
//import org.aopalliance.intercept.MethodInvocation;
//
//import java.util.ArrayList;
//import java.util.List;
//
//public class MyLoadBalanceInterceptor implements MethodInterceptor {
//    List ip_list=new ArrayList();
//    int i=0;
//    @Override
//    public Object invoke(MethodInvocation invocation) throws Throwable {
//        if(i%1000==0) {
//            //http://xw-user/user/addScore?username=
//            String service_name = invocation.getArguments()[0];
//            service_name = service_name.substring(service_name.indexOf("//") + 2, service_name.indexOf("."));
//            ip_list = nacos.api.getServiceList(service_name);
//        }
//       invocation.getArguments()[0]=ip_list.get((i++)%ip_list.size());
//
//       Object r= invocation.proceed();
//        return r;
//    }
//}
